//---------------------------------------------------------------------------------------------------------------------------------------
//---------------------------------------------------------------------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------------------------------------------------------------------
//---------------------------------------------------------------------------------------------------------------------------------------
#ifndef __AP_Cluster_h__
#define __AP_Cluster_h__
//---------------------------------------------------------------------------------------------------------------------------------------
//---------------------------------------------------------------------------------------------------------------------------------------
class Sim_Cluster {

    private:

        int 	x;
        int 	y;
        double	similarity;

    public:

        Sim_Cluster(): x(0), y(0), similarity(0) {};
        Sim_Cluster(int x_tmp, int y_tmp, double similarity_tmp): x(x_tmp), y(y_tmp), similarity(similarity_tmp) {};
        Sim_Cluster(const Sim_Cluster &Sim_Cluster_tmp): x(Sim_Cluster_tmp.x), y(Sim_Cluster_tmp.y), similarity(Sim_Cluster_tmp.similarity) {};
        ~Sim_Cluster() {};

        inline void X(int x_tmp) { if (x_tmp > 0) x = x_tmp; };
        inline void Y(int y_tmp) { if (y_tmp > 0) y = y_tmp; };
        inline void Similarity(double similarity_tmp) { similarity = similarity_tmp; };

        inline int      X(void) { return x; };
        inline int 	Y(void) { return y; };
        inline double   Similarity(void) { return similarity; };

        inline Sim_Cluster operator=(const Sim_Cluster& Sim_Cluster_tmp) { x = Sim_Cluster_tmp.x; y = Sim_Cluster_tmp.y; similarity = Sim_Cluster_tmp.similarity; return *this; };

};
//---------------------------------------------------------------------------------------------------------------------------------------
//---------------------------------------------------------------------------------------------------------------------------------------
class AP_Cluster {

    private:

        Sim_Cluster *dataPoints;
        int          numberDataPoints;
        double      *preferencePoint;
        bool         onePreference;

        int         *idx;
        int          numberCluster;

        //Parameters
        int          maxits;
        int          convits;
        double       dampfact;
        bool         noise;
        static int   cicle;

    protected:

        int CreateSimilarityFile(void);
        int CreatePreferenceFile(void);
        int LoadIdxResult(void);

    public:

        //Constructor and Destructor
        AP_Cluster();
        AP_Cluster(const AP_Cluster*);
        ~AP_Cluster();

        //Input Functions
        void DataPoints(Sim_Cluster*, int);
        void NumberDataPoints(int);
        void PreferencePoint(double*, int);
        void OnePreference(bool);
        void Idx(int*, int);
        void NumberCluster(int);

        void Maxits(int);
        void Convits(int);
        void Dampfact(double);
        void Noise(bool);

        //Output Functions
        Sim_Cluster*    DataPoints(int);
        int             NumberDataPoints(void);
        double          PreferencePoint(int);
        bool            OnePreference(void);
        int             Idx(int);
        int             NumberCluster(void);

        int             Maxits(int);
        int             Convits(int);
        double          Dampfact(double);
        double          Noise(bool);

        //Operations Funtions

        //Utilities functions
        void ComputeAP_Cluster(int);

};
//---------------------------------------------------------------------------------------------------------------------------------------
//---------------------------------------------------------------------------------------------------------------------------------------
#endif
//---------------------------------------------------------------------------------------------------------------------------------------
//---------------------------------------------------------------------------------------------------------------------------------------
